#ifndef __BINARYSORTTREE_H_
#define __BINARYSORTTREE_H_

#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>

#ifndef ElementType
#define ElementType int
#endif

struct BinaryTreeNode
{
    ElementType data;
    struct BinaryTreeNode *left;
    struct BinaryTreeNode *right;
    struct BinaryTreeNode *parent;
};
typedef struct BinaryTreeNode BTNode;

struct BinarySortTree
{
    BTNode *root;
};
typedef struct BinarySortTree BSTree;

void InitBSTree(BSTree *tree);
void InsertElement(BSTree *tree, ElementType element);

void PrevPrint(BSTree *tree);
void MidPrint(BSTree *tree);
void PostPrint(BSTree *tree);

BTNode* FindElement(BSTree *tree, ElementType element);
void RemoveElement(BSTree *tree, ElementType element);

#endif